#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import sys
import subprocess

WIN = sys.platform.startswith('win')

options=[
    "headless",
    "disable-gpu",
    "no-sandbox"]

s=' --options='+','.join(options)


def main():
    """主函数"""
    steps = [
        # "pipenv run pytest -n auto --alluredir allure-results --clean-alluredir --reruns 3 --reruns-delay 2",
        "pdm run pytest -n 4 --alluredir allure-results --clean-alluredir",  #--reruns 3 --reruns-delay 2
        "allure generate allure-results -c -o allure-report",
        "allure open allure-report -h 127.0.0.1 -p 8000"

    ]
    for step in steps:
        subprocess.run("call " + step if WIN else step, shell=True)


if __name__ == "__main__":
    main()
